package kids;

import emergent.Agent;
import emergent.Monitor;

public class Kid extends Agent {

	int value = 0;
	private String name;
	private boolean increasing = false;
	private Kid[][] agents;
	
	public Kid[][] getAgents() {
		return agents;
	}

	public void setAgents(Kid[][] agents) {
		this.agents = agents;
	}

	public Kid getRightHandSideAgent(){
		if (myColumn+2 > supervisor.getWorld().getMaxColumns()){
			return agents[myRow][0];
		} 
		//System.out.println("R R:"+myRow + "C:" + myColumn);
		return (agents[myRow][myColumn+1]);
	}
	
	public int getValue() {
		return value;
	}

	public void setValue(int value) {
		this.value = value;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public boolean isIncreasing() {
		return increasing;
	}

	public void setIncreasing(boolean increasing) {
		this.increasing = increasing;
	}

	public Kid(int id, Monitor supervisor, boolean sync) {
		super(id, supervisor, sync);
		// TODO Auto-generated constructor stub
	}

	public Kid(int id, Monitor supervisor, boolean sync,
			boolean useRandomDelay, int min, int max) {
		super(id, supervisor, sync, useRandomDelay, min, max);
		// TODO Auto-generated constructor stub
	}

	public Kid(int id, Monitor supervisor, boolean sync, int procrastination) {
		super(id, supervisor, sync, procrastination);
		// TODO Auto-generated constructor stub
	}

	@Override
	public String toString() {
	return this.getId() + "  " + this.getValue() + "  " + repeatText(">>", this.getValue());
		
	}
	public String repeatText(String s, int count){
		String temp = "";
		for(int i=0; i<count; i++)
			temp +=s;
		return temp;
	}

}
